package cn.bdqn.mh.response;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 创建人:  zhang
 * 创建日期: 2020/6/26 11:41
 */
@Data
@NoArgsConstructor
public class Result {
    private int code;
    private String message;
    private Object data;
    public Result(ResultCode resuletCode,Object data){
        this.code=resuletCode.getCode();
        this.message=resuletCode.getMessage();
        this.data=data;
    }
    public Result(ResultCode resuletCode){
        this.code=resuletCode.getCode();
        this.message=resuletCode.getMessage();
    }
    //允许使用者自定义错误提示
    public Result(ResultCode resuletCode,String message){
        this.code=resuletCode.getCode();
        this.message=message;
    }

}
